package cn;

//import cn.netty.service.OnlineHandler;
import com.netty.websocket.WebSocketHandler;
import com.netty.websocket.WebSocketServer;

import com.topsoft.common.AppContext;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class AppServer {

    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        ApplicationContext ac = SpringApplication.run(AppServer.class, args);

        /**
         * 项目启动后, 启动 WebSocket
         */

//        //在线用户
//        new Thread(new WebSocketServer(9001, OnlineHandler.class)).start();
//
//        //推流消息
//        new Thread(new WebSocketServer(9002,OnlineHandler.class)).start();

        //tiulo2Erp接口用
        new Thread(new WebSocketServer(9003, WebSocketHandler.class)).start();

        AppContext.initStart(start,ac);
    }
}
